package org.example.proxy.cglib;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author : RXK
 * Date : 2021/6/2 16:50
 * Code Less Think More
 * Desc:
 */
public class DynamicMethodInterceptor implements MethodInterceptor {


    @Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        System.out.println("来啦 来啦 。。。。。");
        Object result = proxy.invokeSuper(obj, args);
        System.out.println("走啦 走啦 ！！！！！！");
        return result;
    }
}
